<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>iFrameUploadFile测试</title>
<script type="text/javascript" src="iFrameUploadFile.js"></script>
</head>
<body>
<form action="">
	<p>
		<label for="JS-iFrameUploadFile-file">上传文件:</label>
		<input type="text" id="JS-iFrameUploadFile-file" name="testFile" />
		<button id="JS-iFrameUploadFile-upload">上传...</button>
		<button id="JS-iFrameUploadFile-browse">浏览...</button>
	</p>
</form>
<script type="text/javascript">
;(function(){
	var FF = iFrameUploadFile('iFrameUploadFile.php', 'test');
	FF.setAcceptFile('image/png, image/jpg, image/jpeg, image/gif');
	document.getElementById('JS-iFrameUploadFile-upload').onclick = function(){
		FF.upload(function(d){
			document.getElementById('JS-iFrameUploadFile-file').value=d.fileInfo.test.name;
		});
		return false;
	}
	document.getElementById('JS-iFrameUploadFile-browse').onclick = function(){
		FF.browse(function(v){
			document.getElementById('JS-iFrameUploadFile-file').value=v;
			alert(v);
		});
		return false;
	}
})();
</script>
</body>
</html>
